﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using DIST.LR.ZHJG.Events;
using DIST.LR.ZHJG.DataModel;
using System.Collections.ObjectModel;

namespace DIST.LR.ZHJG.Pgybc
{
    public partial class Zbgl_KPI : UserControl
    {
        Zbgl_KPIModel kpiModel = new Zbgl_KPIModel();
        public Zbgl_KPI()
        {
            InitializeComponent();
            EventAggregatorRepository
                .EventAggregator
                .GetEvent<GridKpiTypeEvent>()
                .Subscribe(GetKpiTypeEvent);
        }

        public void GetKpiTypeEvent(ObservableCollection<KPIType> _kpiModel)
        {
            kpiModel.KpiInfo = _kpiModel[0].KPIs;
            this.DataContext = kpiModel;
        }


        private void notify_Click(object sender, RoutedEventArgs e)
        {
            //Button bt = sender as Button;
            //StackPanel sp = bt.Parent as StackPanel;
            //string s = sp.Name;
            //Telerik.Windows.Controls.GridViewDataColumn gdc = sp.Parent as Telerik.Windows.Controls.GridViewDataColumn;
            //string s2 = gdc.Header.ToString();
            MessageBox.Show("notify");
        }

        private void delete_Click(object sender, RoutedEventArgs e)
        {
            MessageBox.Show("delete");
        }
    }
}
